package com.dctp.common.vo;

/**
 * 资金变动类型枚举，对应dctp_fund_flow.change_type字段
 */
public enum PushType {

    SIMULATE_ORDER_CLOSE(1, "模拟订单强平"),
    SIMULATE_ORDER_DEAL(2, "模拟订单委托成交"),
    SIMULATE_PROFIT(3, "模拟订单收益"),
    ADMIN_PROFIT(4, "管理员推送");

    private final int code;
    private final String desc;

    PushType(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static PushType fromCode(int code) {
        for (PushType t : values()) {
            if (t.code == code) return t;
        }
        return null;
    }
}
